import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		baseUrl:"https://www.baijixing.com.cn/api/",
		// baseUrl: "http://192.168.10.3:8084/api/",
		// baseUrl:"https://4pb0570129.picp.vip/api/",
		// 联系客服
		url_3: "http://47.108.56.194:8884/api/xieyi/yulan/3",
		// 责任声明
		url_5: "http://47.108.56.194:8884/api/xieyi/yulan/5",
		// 版本更新
		url_6: "https://www.baidu.com/",
		// baseUrl:"http://192.168.2.116:8084/api/",
		// baseUrl:"http://1.14.96.173:8882/admin/",
		// baseUrl:"http://47.108.56.194:8884/api/",
		token: "",
		isLogin: false,
		jsonCode: "",
		sysInfo: null,
		lat: "",
		lng: "",
		address: '', //用户地址
		ip: "",
		wId: '',
		wName: ''
	},
	mutations: {
		setToken(state, token) {
			state.token = token;
			console.log("启动获取到token" + token)
			if (state.token != '' && state.token != undefined) {
				state.isLogin = true;
				uni.setStorageSync("token", token);
			} else {
				state.isLogin = false;
				uni.removeStorageSync("token")
			}
			console.log("state.isLogin" + state.isLogin)
		},
		setLat(state, lat) {
			state.lat = lat
			uni.setStorageSync("lat", lat);
		},
		setLng(state, lng) {
			state.lng = lng
			uni.setStorageSync("lng", lng);
		},
		setAddress(state, address) {
			state.address = address
			uni.setStorageSync("address", address);
		},
		setCity(state, city) {
			uni.setStorageSync("city", city);
		},
		setIp(state, ip) {
			state.ip = ip
			uni.setStorageSync("ip", ip);
		},
		setJsonCode(state, jsonCode) {
			state.jsonCode = jsonCode;
		},
		setSysInfo(state, sysInfo) {
			state.sysInfo = sysInfo;
		},
		setwId(state, wId) {
			state.wId = wId
		},
		setwName(state, wName) {
			state.wName = wName
		},
	},
	getters: {

	},
	actions: {

	}
})
export default store